/*************************************************************************
	> File Name: oj-370_月之谜.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: Sat Feb 13 11:13:34 2021
 ************************************************************************/
#include <iostream>

using namespace std;
#define MAX_N 90
#define LIM 11
int dp[LIM][MAX_N][MAX_N][MAX_N];
int pos[MAX_N];
int base[MAX_N][LIM];

int dfs(int n, int i, int k, int j, int limit) {
    if (n == 0) return i == 0 && j == 0;
    if (!limit) return dp[n][i][k][j];
    int up = limit ? pos[n] : 9;
    int ret = 0;
    for (int num = 0; num <= up && num <= i; ++num) {
        int t = (j + k - (num * base[k][n - 1]) % k) % k;
        ret += dfs(n - 1, i - num, k, t, limit && num == up);
    }
    return ret;
}

int getNum(int n) {
    int y = n, cnt = 0;
    while (n) {
        pos[++cnt] = n % 10;
        n /= 10;
    }
    return cnt;
}

void init_dp() {
    for (int i = 1; i < 90; ++i) {
        base[i][0] = 1;
        for (int j = 1; j < 11; ++j) {
            base[i][j] = base[i][j - 1] * 10 % i;
        }
    }
    for (int n = 0; n < 10; ++n) {
        for (int k = 1; k < 90; ++k) {
            dp[1][n][k][n % k] += 1;
        }
    }
    for (int n = 2; n <= 10; ++n) {
        for (int i = 0; i < 90; ++i) {
            for (int k = 1; k < 90; ++k) {
                for (int j = 0; j < k; ++j) {
                    dp[n][i][k][j] = 0;
                    for (int p = 0; p <= 9 && p <= i; ++p) {
                        int t = (j + k - (p * base[k][n - 1]) % k) % k;
                        dp[n][i][k][j] += dp[n - 1][i - p][k][t];
                    }
                }
            }
        }
    }
}

int is_valid(int x) {
    int y = x, z = 0;
    while (x) {
        z += x % 10;
        x /= 10;
    }
    return y % z == 0;
}

int main() {
    init_dp();
    int l, r;
    while (cin >> l >> r) {
        cout << (getNum(r) - getNum(l - 1)) << endl;
    }
    return 0;
}
